﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master" CodeFile="LotesAdmin.aspx.cs" Inherits="Stock_LotesAdmin" %>

<%@ Register Src="../UserControls/Rubros.ascx" TagName="Rubros" TagPrefix="uc1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1"  ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="text-align: center; vertical-align: text-top;">
    <asp:ScriptManager id="ScriptManager1"
                runat="server"></asp:ScriptManager>
                
                <h1 style="text-align: left">
            &nbsp; Administraci&oacute;n de Lotes</h1>
<table class="tablaForm" style=" width:100%; text-align:left">
    <tr>
        <td class="tdStock" align="right" colspan="3">Administraci&oacute;n de Lotes Abiertos de un Art&iacute;culo</td></tr>
      <tr>
                <td class="tdLiteral" style="width: 20%; text-align: right">
                    <asp:Label ID="lblRubro" runat="server" CssClass="label" Text="Rubro:"></asp:Label></td>
                <td class="tdForm" style="width: 80%; text-align: left">
                    <asp:TextBox ID="txtRubro" runat="server" CssClass="cuadrotxt100" ReadOnly="True"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="tdLiteral" style="width: 20%; text-align: right">
                    <asp:Label ID="lblSubRubro" runat="server" CssClass="label" Text="SubRubro:"></asp:Label></td>
                <td class="tdForm" style="width: 80%; text-align: left">
                    <asp:TextBox ID="txtSubRubro" runat="server" CssClass="cuadrotxt100" ReadOnly="True"></asp:TextBox></td>
            </tr>
      <tr>
                <td align="right" class="tdForm" style="width: 20%">
                    C&oacute;digo:&nbsp;</td>
                <td align="left" class="tdForm" style="width: 80%">
                    <asp:TextBox ID="txtCodigo" runat="server" CssClass="cuadrotxt"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right" class="tdForm" style="width: 20%; height: 23px">
                    Art&iacute;culo:&nbsp;</td>
                <td align="left" class="tdForm" style="width: 80%; height: 23px">
                    <asp:TextBox ID="txtArticulo" runat="server" CssClass="cuadrotxt100"></asp:TextBox>
                </td>
            </tr>
    <tr>
        <td align="right" class="tdForm" style="width: 20%; height: 23px">
            Stock en Lotes:
        </td>
        <td align="left" class="tdForm" style="width: 80%; height: 23px">
            <asp:TextBox ID="txtTLotes" runat="server" CssClass="cuadrotxt" ReadOnly="True"></asp:TextBox></td>
    </tr>
    <tr>
        <td align="right" class="tdForm" style="width: 20%; height: 23px">
            Stock Sin Asignar:</td>
        <td align="left" class="tdForm" style="width: 80%; height: 23px">
            <asp:TextBox ID="txtSinLote" runat="server" CssClass="cuadrotxt" ReadOnly="True"></asp:TextBox></td>
    </tr>
    <tr>
        <td align="right" class="tdForm" style="width: 20%; height: 23px">
            Total Stock:</td>
        <td align="left" class="tdForm" style="width: 80%; height: 23px">
            <asp:TextBox ID="txtSaldo" runat="server" CssClass="cuadrotxt" ReadOnly="True"></asp:TextBox></td>
    </tr>
            <tr>
                <td class="tdBotones" colspan="2">
                    &nbsp;<asp:Button ID="btnNuevo" runat="server" OnClick="btnNuevo_Click" Text="Nuevo" Width="75px" />
                    <asp:Button ID="Button1" runat="server" OnClick="btnCancelar_Click" Text="Cancelar"
                        Width="75px" />
                </td>
            </tr>
    <tr>
        <td class="tdForm" colspan="2" style="width: 60%; text-align:center">
            <asp:GridView id="gvLotes" runat="server" BorderWidth="1px" BackColor="White" Width="60%" 
                OnPageIndexChanging="gvLotes_PageIndexChanging" 
                OnSelectedIndexChanged="gvLotes_SelectedIndexChanged" 
                OnRowDataBound="gvLotes_RowDataBound" 
                CellPadding="3" AllowPaging="True" AutoGenerateColumns="False" 
                DataKeyNames="Lote" BorderColor="#999999" BorderStyle="None" GridLines="Vertical" PageSize="15">
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black"></FooterStyle>
                <columns>
                    <asp:TemplateField HeaderText="Lote">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Lote" runat="server" Text='<%# Bind("Lote") %>'></asp:Label> 
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="Fecha Vto.">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="FechaVto" runat="server" Text='<%# Bind("FechaVto", "{0:dd/MM/yyyy}") %>'></asp:Label> 
                        </ItemTemplate>
                         <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="Saldo">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Saldo" runat="server" Text='<%# Bind("Saldo", "{0:F2}") %>'></asp:Label> 
                        </ItemTemplate>
                         <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                    <asp:TemplateField HeaderText="Costo">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Costo" runat="server" Text='<%# Bind("Costo", "{0:F2}") %>'></asp:Label> 
                        </ItemTemplate>
                         <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <HeaderStyle ForeColor="White"></HeaderStyle>
                        <ItemTemplate>
                            <asp:LinkButton runat="server" Text="Editar" CommandName="Select" CausesValidation="False" id="LinkButton2"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                </columns>
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center"></RowStyle>
                <EditRowStyle Wrap="True"></EditRowStyle>
                <SelectedRowStyle BackColor="#008A8C" ForeColor="White" Font-Bold="True"></SelectedRowStyle>
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
                <HeaderStyle BackColor="#325FB9" ForeColor="White" Font-Names="Arial Rounded MT Bold" Font-Bold="True"></HeaderStyle>
                <AlternatingRowStyle BackColor="Gainsboro"></AlternatingRowStyle>
            </asp:GridView>
            </td>
            </tr>
        </table><br /><br />
    </div>
     <asp:Panel ID="pTipo" runat="server" CssClass="tdBotones" Style="display: none" Width="233px">
        <div style="text-align:center; background-image: none; background-color: transparent;">
            Art&iacute;culo sin Lotes Abiertos<br />
            <br />
            <asp:Button ID="btnOkTipo" runat="server" Text="OK" Width="64px"/>
        </div>
    </asp:Panel>
       <table border="0" id = "OcultarTipo" runat="server" style="width: 0px; height: 0px">
            <tr>
                <td style="width: 100px; height: 18px;">
                    <asp:Button ID="Button3" runat="server" Text="Button" Height="0px" Width="0px" />
                </td>
            </tr>
        </table>          
     <cc1:ModalPopupExtender ID="mpeLote" runat="server" backgroundcssclass="modalBackground"
        dropshadow="true" okcontrolid="btnOkTipo" popupcontrolid="pTipo" targetcontrolid="Button3">
    </cc1:ModalPopupExtender>
</asp:Content>
